
import Foundation


extension Result {
    
    var isSuccess: Bool {
        if case .success = self { return true }
        return false
    }
    
    var isFailure: Bool {
        return !isSuccess
    }
    
    var successValue: Success? {
        if case .success(let value) = self { return value }
        return nil
    }
    
    var failureValue: Failure? {
        if case .failure(let error) = self { return error }
        return nil
    }
    
}
 
